#!/bin/bash

set -ex

goversion="1.24.4"

if [ ! -d loongarch64 ]; then
	tar -xf loongarch64-${goversion}.tar.gz
fi

for p in $(cat loongarch64-${goversion}.conf); do
	git apply -p1 loongarch64/$p
done

rm -rf $0 loongarch64 loongarch64-${goversion}.tar.gz loongarch64-${goversion}.conf
